package com.zhengxing.jienci.user.domain.rbac;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * Resource
 *
 * @author philbert
 * @version 1.00
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("SYS_RESOURCE")
public class Resource {

    @TableId("ID")
    private String id;
    @TableField("PARENT_ID")
    private String parentId; // 父ID。0=一级资源
    @TableField("NAME")
    private String name; // 名称
    @TableField("CODE")
    private String code; // 代码
    @TableField("ICON")
    private String icon; // 图标
    @TableField("URL")
    private String url; // URL
    @TableField("SORT_NO")
    private Integer sortNo; // 排序号
    @TableField("REMARK")
    private String remark; // 备注
    @TableField("CREATED_AT")
    private Long createdAt;
    @TableField("UPDATED_AT")
    private Long updatedAt;

    @TableField(exist = false)
    private List<Resource> children = new ArrayList<>(); // 子资源

}
